package com.pikaqiu.warehouse.domain.dto;

import com.pikaqiu.warehouse.domain.entity.Materials;
import com.pikaqiu.warehouse.domain.entity.Products;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @Author: Administrator
 * @Date: 2024/8/15
 */
@Data
public class ProductMaterialsLinkDto {

    private Integer id;

    private String name;

    private String image;

    private String unit;

    private BigDecimal stock;

    private BigDecimal quantity;

    private String categoryName;

    public ProductMaterialsLinkDto(Materials materials, String categoryName, BigDecimal quantity) {
        this.id = materials.getId();
        this.name = materials.getName();
        this.unit = materials.getUnit();
        this.image = materials.getImages();
        this.stock = materials.getStock();
        this.categoryName = categoryName;
        this.quantity = quantity;
    }

    public ProductMaterialsLinkDto(Products products, String categoryName, BigDecimal quantity) {
        this.id = products.getId();
        this.name = products.getName();
        this.unit = products.getUnit();
        this.image = products.getImages();
        this.stock = products.getStock();
        this.categoryName = categoryName;
        this.quantity = quantity;
    }
}
